import request from '@/utils/request'
// 工单状态列表
export const orderState = () => {
  return request({
    url: '/api/task-service/task/allTaskStatus'
  })
}

// 获取工单所有数据
export const orderList = (params) => {
  return request({
    url: '/api/task-service/task/search',
    params
  })
}

// 获取工单详情
export const orderDetail = (params) => {
  return request({
    url: `/api/task-service/task/taskInfo/${params.taskId}`,
    params
  })
}

// 获取补货详情
export const repDetail = (params) => {
  return request({
    url: `/api/task-service/taskDetails/${params.taskId}`,
    params
  })
}

// 获取补货预警值
export const repVal = () => {
  return request({
    url: '/api/task-service/task/supplyAlertValue'
  })
}

// 取消工单
export const cancelOrder = (data) => {
  return request({
    url: `/api/task-service/task/cancel/${data.taskId}`,
    method: 'POST',
    data
  })
}

// 创建工单
export const createOrder = (data) => {
  return request({
    url: '/api/task-service/task/create',
    method: 'POST',
    data
  })
}

// 获取运营人员列表
export const getInner = (code) => {
  return request({
    url: `/api/user-service/user/operatorList/${code}`
  })
}

// 获取售货机货道详情
export const channelApi = (code) => {
  return request({
    url: `/api/vm-service/channel/channelList/${code}`
  })
}
